function OS_KeyConfig(host,id)
{
	this.$super = OS_Resource;
	if (this.$super(host,id)===false) return;
	delete this.$super;
	
	var keymap={};
	
	this.load = function(handler)
	{
		var keys=this.resourceNode.getElementsByTagName("key");
		for (var i=0;i<keys.length;i++)
		{
			var key=keys[i];
			var value=key.getAttribute("value");
			var keyCodes=key.getElementsByTagName("keyCode");
			for (var j=0;j<keyCodes.length;j++)
			{
				var keyCode=keyCodes[j].childNodes[0].nodeValue;
				keymap[keyCode]=value;
			}
		}
		this.loaded=true;
		handler(this);
	}
	
	this.keycode=function(code)
	{
		if (!keymap[code])
		{
			return keymap["default"];
		}
		else
		{
			return keymap[code];
		}
	}
	
	host.control.keyConfig(this);
}

OS_Resource.Builder.put("keys",OS_KeyConfig);